package com.immunology.service;

import java.util.List;
import java.util.Map;

import com.immunology.dao.ComplaintTypeDao;
import com.immunology.database.transformers.ComplaintTypeTransformer;
import com.immunology.model.ComplaintType;

public class ComplaintTypeService {

	private static ComplaintTypeService complaintTypeService = null;
	private ComplaintTypeDao complaintTypeDao = new ComplaintTypeDao(
			new ComplaintTypeTransformer());

	private ComplaintTypeService() {
	}

	public static ComplaintTypeService getInstance() {
		if (complaintTypeService == null) {
			complaintTypeService = new ComplaintTypeService();
		}
		return complaintTypeService;
	}

	public void insert(String complaintTypeName, double multyplier,
			int syndromeId) {
		ComplaintType complaintType = new ComplaintType();
		complaintType.setName(complaintTypeName);
		complaintType.setMultyplier(multyplier);
		complaintType.setSyndromeId(syndromeId);
		complaintTypeDao.insert(complaintType);
	}

	public void delete(int complaintTypeId) {
		complaintTypeDao.delete(complaintTypeId);
	}
	public void update(int complaintTypeId, ComplaintType complaintType) {
		complaintTypeDao.update(complaintTypeId, complaintType);
	}
	

	public Map<String, List<ComplaintType>> getComplaintTypeList() {
		return complaintTypeDao.getComplaintTypeList();
	}

	public List<ComplaintType> getComplaintTypeListBySyndromeId(int syndromeId) {
		return complaintTypeDao.getComplaintTypeListBySyndromeId(syndromeId);
	}

	public ComplaintType getComplaintTypeById(int complaintTypeId) {
		return complaintTypeDao.getById(complaintTypeId);
	}

}
